package org.smr.ministore.micro.client;

import java.util.List;

import org.blade.utils.Pager;
import org.smr.ministore.entities.DictionaryOrgan;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("DictionaryOrgan.Service")
public interface FeignDictionaryOrganMicroServiceClient {

    @RequestMapping(method = RequestMethod.PUT, value = "/DictionaryOrgan/batchSave")
    int batchSave(@RequestBody List< DictionaryOrgan> entities);

    @RequestMapping(method = RequestMethod.POST, value = "/DictionaryOrgan/batchModify")
    int batchModify(@RequestBody List< DictionaryOrgan> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/DictionaryOrgan/save")
    public int save(@RequestBody DictionaryOrgan entity) ;

    @RequestMapping(method = RequestMethod.PATCH, value = "/DictionaryOrgan/updateById")
    public int updateById(@RequestBody DictionaryOrgan id);

    @RequestMapping(method = RequestMethod.GET, value = "/DictionaryOrgan/queryById/{id}")
    public  DictionaryOrgan queryById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/DictionaryOrgan/deleteById/{id}")
    public int deleteById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/DictionaryOrgan/paginate/{pageSize}/{pageNum}")
    public Pager<DictionaryOrgan> paginate( @RequestBody DictionaryOrgan entity,
                                            @PathVariable("pageSize") Long pageSize,
                                            @PathVariable("pageNum") Long pageNum);


    @ResponseBody
    @RequestMapping( method = RequestMethod.POST, value = "/DictionaryOrgan/assignedDictionary/{organId}")
    public int assignedDictionary(@RequestBody List<DictionaryOrgan> dictionaryOrganList,
                                  @PathVariable("organId") Long organId);

}
